package org.automated.realestatemanager.db.services;

public class ServiceFactory {

	private ServiceFactory() {

	}

	static AdvertisementService advertisementService;
	static CategoryService categoryService;
	static PhoneService phoneService;
	static UserRoleService userRoleService;
	static UserStatusService userStatusService;
	static UserService userService;
	static PublisherService publisherService;
	static AgencyService agencyService;

	static ServiceFactory serviceFactory = null;

	public static ServiceFactory getInstance() {
		if (serviceFactory == null) {
			serviceFactory = new ServiceFactory();
		}
		return serviceFactory;
	}

	public UserService getUserService() {
		if (userService == null) {
			userService = new UserService();
		}
		return userService;
	}

	public UserRoleService getUserRoleService() {
		if (userRoleService == null) {
			userRoleService = new UserRoleService();
		}
		return userRoleService;
	}

	public UserStatusService getUserStatusService() {
		if (userStatusService == null) {
			userStatusService = new UserStatusService();
		}
		return userStatusService;
	}

	public AdvertisementService getAdvertisementService() {
		if (advertisementService == null) {
			advertisementService = new AdvertisementService();
		}
		return advertisementService;
	}

	public PhoneService getPhoneService() {
		if (phoneService == null) {
			phoneService = new PhoneService();
		}
		return phoneService;
	}

	public static CategoryService getCategoryService() {
		if (categoryService == null) {
			categoryService = new CategoryService();
		}
		return categoryService;
	}

	public static PublisherService getPublisherService() {
		if (publisherService == null) {
			publisherService = new PublisherService();
		}
		return publisherService;
	}

	public static AgencyService getAgencyService() {
		if (agencyService == null) {
			agencyService = new AgencyService();
		}
		return agencyService;
	}

}
